package com.itheima.generic;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class SetDemo {
    public static void main(String[] args) {
        Set<String> ss = new TreeSet<>();
        ss.add("李四");
        ss.add("张三");
        ss.add("王五");
        ss.add("王五");
        ss.add("赵六");
        System.out.println(ss);
        Iterator<String> iterator = ss.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
